<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript" src="Vue.js"></script>

</head>
<body>
	<div id="root">
		姓:<input v-model="fN"/>
		名:<input v-model="lN"/>
		<div>{{fullName}}</div>
		<div>{{count}}</div>
	</div>

	<script type="text/javascript">
		
		new Vue ({
			el:"#root",
			data: {
				fN:"",
				lN:"",
				count:0
			},
			computed: {
				fullName:function() {
					return this.fN + ' ' + this.lN
				}
			},
			watch: {
				fN:function () {
					this.count ++
				},
				lN:function () {
					this.count ++
				}

			}
		})
	</script>
</body>
</html>